package com.xxxx;

import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * 批量数据处理
 */
public class Hello10FlinkOperatorRescale {
    public static void main(String[] args) throws Exception {
        //创建环境
        StreamExecutionEnvironment environment = StreamExecutionEnvironment.createLocalEnvironmentWithWebUI(new Configuration());
        //获取数据源
        DataStreamSource<String> source0 = environment.socketTextStream("localhost", 18880);
        DataStreamSource<String> source1 = environment.socketTextStream("localhost", 18881);
        //开始转换
        source0.rescale().print("rescale0:");
        source1.rescale().print("rescale1:");

        //执行流
        environment.execute("Hello08FlinkOperatorConnect" + System.currentTimeMillis());

    }
}
